package cn.wang.pojo;

import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 商品分组类
 */
@Data
@Table(name = "tb_spec_group")
public class SpecGroup {

    @Id
    @KeySql(useGeneratedKeys = true)
    private Long id;

    @NotNull(message = "传入商品id为空, 请传递商品id")
    private Long cid;

    @NotNull(message = "输入的名字为null, 请输入名称")
    @NotEmpty(message = "输入的名称为空字符串, 请输入名称")
    private String name;

    @Transient
    private List<SpecParam> params;

}